import actions from '@/shared/actions';

export const qiankun = {
  // 应用加载之前
  async bootstrap(props: any) {
    console.log('app1 bootstrap');
  },
  // 应用 render 之前触发
  async mount(props: any) {
    console.log('app1 mount');
    // props.onGlobalStateChange((state, prev) => {
    //   // state: 变更后的状态; prev 变更前的状态
    //   console.log(state, prev);
    // });
    // props.setGlobalState({ name: '李四' });
    // 注入 actions 实例
    actions.setActions(props);
  },
  // 应用卸载之后触发
  async unmount(props: any) {
    console.log('app1 unmount');
  },
};
